Repository navigation
Support gradient checkpointing in Graph-EFM - #920
Draft
Sir-Sloth-The-Lazy wants to merge 42 commits into
Draft
Sir-Sloth-The-Lazy wants to merge 42 commits into
Sir-Sloth-The-Lazy wants to merge 42 commits into
Conversation
Train hierarchical and flat Graph-EFM models through the merged probabilistic interfaces with a Gaussian ELBO and optional fair CRPS from prior trajectories. Wire configuration, model selection, and checkpoint restoration into the current training pipeline, preserving increment rescaling and clamping. Add numerical objective, gradient, training, checkpoint, and configuration tests, and document the model settings using the repository's docstring conventions.
Restore probabilistic architecture settings from checkpoints, share fair CRPS scoring, and warn about ignored deterministic options. Name Graph-EFM runs using configured layer depths, simplify module assembly, and allow callers to reuse graph embeddings.
Share probabilistic config restoration between the checkpoint helper and fit so evaluation and resumed training build the saved architecture. Warn on conflicting explicit YAML settings and preserve the legacy fallback when checkpoint configuration is unavailable. Add dummy-data CLI regressions for both graph families and document checkpoint precedence.
The encoder approximates the target-conditioned posterior rather than computing the true posterior; name and document that distinction. Review: mllam#712 (comment)
Replace the forecaster ownership boilerplate with the variational reconstruction, KL and optional prior-sampled CRPS objective. Review: mllam#712 (comment)
The CRPS samples come from separate prior trajectories, not the target-conditioned variational rollout; clarify the extra sampling cost. Review: mllam#712 (comment)
CRPS and ensemble sampling recomputed static graph embeddings at every step; compute them once per batch and share them with independent prior rollouts while retaining gradients. Review: mllam#712 (comment)
Summing CRPS over grid points and forecast steps changed the meaning of the paper's tuning weights; average those dimensions and the batch while summing variables. Review: mllam#712 (comment)
Expose empirical, fair and almost-fair CRPS variants from the approach in mllam#226, preserving the fair training API and using the correctly normalized direct pair difference for two members. Review: mllam#712 (comment)
Move device-list, automatic-device and multi-node detection out of trainer construction so unused-parameter handling is reusable and independently testable. Review: mllam#712 (comment)
Graph-EFM trains all networks when KL is enabled; only request DDP unused-parameter detection during zero-KL training and only when multiple devices or nodes are used. Review: mllam#712 (comment)
Architecture, objective and ensemble-size settings belonged to a special YAML section unlike other models; expose them through argparse and the existing typed run configs instead. Review: mllam#712 (comment)
Restoring saved probabilistic settings unconditionally prevented changing KL and CRPS weights for the next stage; inherit only unspecified Graph-EFM options and preserve explicit overrides, including zero. Review: mllam#712 (comment)
The generic predictor builder mixed deterministic GNN arguments with Graph-EFM latent and layer settings; delegate Graph-EFM construction to a dedicated helper. Review: mllam#712 (comment)
The helper constructs a forecaster and selects a Lightning module class without instantiating that module; rename it to build_forecaster to avoid implying otherwise. Review: mllam#712 (comment)
Replace the implementation-history paragraph with one feature summary in the Added section. Review: mllam#712 (comment)
Move Graph-EFM into the model guide, explain its ensemble objective, and provide the paper's MEPS training curriculum with CLI stage and checkpoint examples. Review: mllam#712 (comment)
Accept and ignore pred_std in the shared positional slot, including vector scales, and warn before reducing a single-member CRPS to MAE without dropping masking or variable reductions. Keep the fair training wrapper strict about requiring two members. Port the reviewed behavior from mllam#226. Review: mllam#226 (comment)
Make fair, biased and almost-fair CRPS (alpha 0.95) available through get_metric using the standard pred/target/pred_std interface. Reject ensemble metrics as deterministic losses and validate the prediction layout to avoid silently scoring the wrong axis. Build on mllam#226 by @shauryam2807. Review: mllam#226 (comment)
Limit temporary scoring allocations by splitting a caller-selected batch, forecast-step or spatial dimension. Default to unchunked scoring, preserve gradients, and keep masking and reduction after reassembly. Values and gradients match unchunked scoring for every estimator. Refs mllam#226. Review: mllam#226 (comment) Review: mllam#226 (comment)
Add spread_squared with Bessel correction, the shared metric signature, interior masking and variable reductions. Reject ensembles with fewer than two members and verify values, dimensions and gradients. Absorb the spread metric work from mllam#226 by @shauryam2807 into mllam#712.
Score one evaluation ensemble with mean error, fair CRPS and unbiased variance on interior nodes. Convert averaged variance to spread only after sample aggregation, then restore physical units so reported spread is comparable with RMSE. Preserve single-member mean-error evaluation. Refs mllam#226 and mllam#712.
Move Graph-EFM instructions into the training guide, retain deterministic rollout checkpointing, and document how existing checkpoints use the current run configuration.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
Use
--gradient_checkpointingfor Graph-EFM so the variational predictor step and the prior steps used for CRPS can be recomputed in the backward pass. The rollouts share the static graph embeddings, and recomputation preserves the random draws for each step. The option is off by default.This draft is based on #712. Once that lands, I’ll rebase the follow-up onto
main.Issue Link
Closes #918.
Type of change
Checklist before requesting a review
pullwith--rebaseoption if possible).Checklist for reviewers
Each PR comes with its own improvements and flaws. The reviewer should check the following:
Author checklist after completed review
reflecting type of change (add section where missing):
Checklist for assignee